package com.tuocent.dagv2.service;

import com.alibaba.fastjson.JSONObject;
import com.tuocent.dagv2.common.AjaxResult;
import com.tuocent.dagv2.common.entity.LoginUser;
import com.tuocent.dagv2.entity.Users;
import com.baomidou.mybatisplus.extension.service.IService;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpSession;
import org.springframework.ui.Model;

import java.util.Map;

/**
 * <p>
 * 用户列表 服务类
 * </p>
 *
 * @author Vincent
 * @since 2025-07-22
 */
public interface IUsersService extends IService<Users> {

    AjaxResult userLogin(HttpServletRequest request, LoginUser userInfo, HttpSession session);

    String userInfo(Model model);

    AjaxResult getUserData(Map<String, Object> param);

    String setUserInfo(Model model, String id);

    AjaxResult saveUserInfo(HttpSession session, Users data);

    AjaxResult delUserInfo(HttpSession session, String id);

    AjaxResult setUserEnabled(HttpSession session, Map<String, Object> params);

    AjaxResult resetPassword(HttpSession session, Map<String, Object> params);

    AjaxResult setNewPassword(HttpSession session, String oldPwd, String newPwd);

    String setUserRole(Model model, String userId);

    AjaxResult getUserRole(HttpSession session, String userId);

    AjaxResult saveUserRole(HttpSession session, JSONObject params);

    AjaxResult RestUserLogin(HttpServletRequest request, LoginUser userInfo, HttpSession session);
}
